<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html">

<cc:interface>
    <cc:attribute name="name" default=""/>
    <cc:attribute name="series" type="ch.genidea.jsfcharts.highcharts.ColumnChartSeries"/>
</cc:interface>


<cc:implementation>

    if(typeof options.xAxis.categories === "undefined") {
    options.xAxis.categories = [<ui:repeat value="#{cc.attrs.series.columns}" var="column">
    '#{column.name}',
</ui:repeat>];
    }
    var data = [<ui:repeat value="#{cc.attrs.series.columns}" var="column">
    #{column.value},
</ui:repeat>] ;

    var series = {
    type: 'column',
    name: '#{cc.attrs.name}',
    data: data
    };
    if(typeof options.series === "undefined") {
    options.series = [];
    }
    options.series.push(series);
</cc:implementation>
</html>
